<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript" src="./Public/Js/jquery.min.js"></script> 
        <script type="text/javascript" src="./Public/Js/jquery.artDialog.js?skin=default"></script> 
        <script type="text/javascript" src="./Public/Js/iframeTools.js"></script>
        <link rel='stylesheet' type='text/css' href='./Public/Css/style.css'>
            <title>班级管理</title>
    </head>
    <body style="background:#E2E9EA">
		<div style="width:100%;height:100%;background:#ccc;position:absolute;z-index:999;display:none;" id="banjiadd">
			<a href="javascript:;" style="color:#f00;float:right;margin-right:10%;margin-top:20px;" onclick="hide_banjiadd()">返回</a>
			<div style="clear:both;"></div>
			<div style="width:200px;height:140px;background:#fff;margin:0 auto;margin-top:100px;padding:20px;">
				<form name="formadd" method="post" action="<?php echo U('Admin/Index/banjiadddo/');?>">
				<div style="width:200px;height:30px;line-height:30px;padding-top:10px;">
					<span>班级名称:</span>
					<input type="text" id="addtitle" name="addtitle" />
				</div>
				<div style="width:200px;height:30px;line-height:30px;padding-top:10px;">
					<span>所属园所:</span>
					<select id="addyuansuo" name="addyuansuo">
						<?php if(is_array($addyuansuo)): $i = 0; $__LIST__ = $addyuansuo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$addyuansuo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($addyuansuo["id"]); ?>"><?php echo ($addyuansuo["catname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
					</select>
				</div>
				<div style="width:200px;height:30px;line-height:30px;padding-top:10px;">
					<input type="submit" value="保存" style="cursor:pointer;" />
				</div>
				</form>
			</div>
		</div>
		<script>
		function show_banjiadd(){
			$('#banjiadd').show();		
		}
		function hide_banjiadd(){
			$('#banjiadd').hide();		
		}
		</script>
		<div style="width:100%;height:100%;background:#ccc;position:absolute;z-index:999;display:none;" id="banjiedit">
			<a href="javascript:;" style="color:#f00;float:right;margin-right:10%;margin-top:20px;" onclick="hide_banjiedit()">返回</a>
			<div style="clear:both;"></div>
			<div style="width:200px;height:140px;background:#fff;margin:0 auto;margin-top:100px;padding:20px;">
				<form name="formedit" method="post" action="<?php echo U('Admin/Index/banjieditdos/');?>">
				<div style="width:200px;height:30px;line-height:30px;padding-top:10px;">
					<span>班级名称:</span>
					<input type="hidden" name="editid" id="editid" />
					<input type="text" name="edittitle" id="edittitle" />
				</div>
				<div style="width:200px;height:30px;line-height:30px;padding-top:10px;">
					<span>所属园所:</span>
					<select name="edityuansuo" id="edityuansuo">
						
					</select>
				</div>
				<div style="width:200px;height:30px;line-height:30px;padding-top:10px;">
					<input type="submit" value="保存" style="cursor:pointer;" />
				</div>
				</form>
			</div>
		</div>
		<script>
			function show_banjiedit(t){
				$('#banjiedit').show();		
				$.post("<?php echo U('Admin/Index/banjieditdoajax/');?>",{id:t}, function(v){
					$('#editid').val(v.id);
					$('#edittitle').val(v.title);
					$('#edityuansuo').html(v.banjioption);
				},"json");
			}
			function hide_banjiedit(t){
				$('#banjiedit').hide();		
			}
		</script>
		<div id="nav" class="mainnav_title">
			<ul>
				<a href="javascript:;">班级管理</a>|
		
				<a href="javascript:;" onclick="show_banjiadd()">添加班级</a>
			</ul>
		</div>
		
		<div class="table-list">
			<table width="100%" cellspacing="0">
				<thead>
					<tr>
						<th width="40">ID</th>
						<th width="40">班级名称</th>
						<th width="60">所属园所</th>
						<th width="72"><?php echo L('manage');?></th>
					</tr>
				</thead>
				<tbody>
				<?php if(is_array($list)): $k = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><tr>
						<td align="center"><?php echo ($vo['id']); ?></td>
						<td align="center"><a href="javascript:;" ><?php echo ($vo['title']); ?> </a></td>
						<td align="center"><?php echo ($vo['yuansuo']); ?></td>
						<td align="center"><a href="javascript:;" onclick="show_banjiedit(<?php echo ($vo["id"]); ?>)"><?php echo L('edit');?></a> | <a href="javascript:;" onclick="del_banjis(<?php echo ($vo["id"]); ?>)"><?php echo L('delete');?></a></td>
					</tr><?php endforeach; endif; else: echo "" ;endif; ?>
				</tbody>
			</table>
	
		</div>
		
		<script>
			function del_banjis(t){
				$.post("<?php echo U('Admin/Index/delbanjiajax/');?>",{id:t}, function(v){
					alert(v);
					location.reload();
				});
			}
		</script>
		<div id="pages" class="page"><?php echo ($pages); ?></div>
    </body>
</html>